<?php
/**
 * Created by PhpStorm.
 * User: Sky
 * Date: 16/1/26
 * Time: 上午10:23
 */
use yii\helpers\Html;
use yii\helpers\Url;
use app\lib\WeixinUtils;

/* @var $this yii\web\View */
/* @var $content string 字符串 */


$web = Url::to("@web");
?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta content="telephone=no" name="format-detection"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>兑换详情</title>
    <link href="<?= $web ?>/css/global.css" rel="stylesheet"/>
    <link href="<?= $web ?>/css/wx/gift-exchange-detail.css" rel="stylesheet"/>
    <script src="<?= $web ?>/js/jquery.js"></script>
    <meta charset="utf-8"/>

    <script type="text/javascript">
        $(document).ready(function(){
            var w = $(document).width();
            if (w > 640) {
                w = 640;
            }
            $("body").css("font-size", w * 20 / 320);


        })

        function href_card_list() {
            window.location.href = "<?=Url::to(["wx-biz/card-list"]);?>";
        }
        function href_view_wlxx() {
            window.location.href = "<?=Url::to(["wx-home/view-wlxx", 'orderNo' => $card_code_id, 'giftCode' => $good['GOODS_CODE']]);?>";
        }
    </script>
</head>
<body>
<div class="main">
    <div class="gift-container">
        <div class="title-container"
             style="background-image: url(<?= $web ?>/img/wx/gift-exchange-detail/title-bg-normal.png);">
            <div class="title-content">
                <div class="logo"
                     style="background-image: url(<?= $web ?>/img/wx/gift-exchange-detail/rectangle.png);"></div>
                <div class="logo-text"
                     style="background-image: url(<?= $web ?>/img/wx/gift-exchange-detail/rectangle1.png);"></div>
                <div class="title">
                    <table cellspacing="0" cellpadding="0">
                        <tr>
                            <td id="title-main"><?= $good['NAME'] ?></td>
                        </tr>
                        <tr>
                            <td id="title-desc">有效期：<?= $good['VALID_DATE_MESSAGE'] ?></td>
                        </tr>
                    </table>
                </div>
            </div>

            <?php
                 if($user!=null){
            ?>
                    <div class="bless-container">
                        <div class="user-head">
                            <img src="<?= $user['HEADER_URL'] ?>"/>
                        </div>
                        <div class="user-bless">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td id="user-target"><?= $user['NICK_NAME'] ?>：</td>
                                </tr>
                                <tr>
                                    <td id="bless-text"><?= $blessing?></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                <?php
                 }
            ?>


        </div>
    </div>
    <?php
    if($status==2) {
        ?>
        <div id="goods_frame">
            <div class="gift-list">
                <div class="list-item">
                    <div id="gift-img-div">
                        <img src="<?= $good['GOODS_IMG_URL'] ?>"/>
                    </div>
                    <div class="item-left">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td id="gift-name">
                                    <div><label><?= $good['GOODS_NAME'] ?></label></div>
                                </td>
                            </tr>
                            <tr>
                                <td id="gift-status">已兑换</td>
                            </tr>
                        </table>
                    </div>

                </div>

            </div>
            <div class="view-ems" onclick="href_view_wlxx()">
                <div id="ems-left">查看物流信息</div>
                <div id="ems-right">
                    <img src="<?= $web ?>/img/wx/gift-exchange-detail/go.png"/>
                </div>
            </div>
            <div class="receive-info-container">
                <div class="receive-person">
                    收货信息：<?= $good['RECEIVER_NAME'] ?>&nbsp;<?= $good['RECEIVER_PHONE'] ?>
                </div>
                <div class="receive-address">
                    <?= $good['SHENG'] ?><?= $good['SHI'] ?><?= $good['QU'] ?><?= $good['RECEIVER_ADDRESS'] ?>
                </div>
            </div>
        </div>
        <?php
    }
    if($status==5) {
        ?>
        <div class="exchanged-info" id="doracoin_frame">
            <span>已兑换成 <?= $doracoin["DORACOIN"] ?> 朵拉币</span>
            <div style="text-align: left; margin: 10px; font-size: 0.6em; color:#333333;">
                <p>产品使用描述：</p>
                <p>1.朵拉币可累积使用，不可赚赠，无有效时限限制；</p>
                <p>2.开始使用时间：2016年3月1日起开始使用；</p>
                <p>3.适用范围：朵拉商城内朵拉币专区内全场适用，结算支付时直接抵现。使用朵拉币购买的产品不享受分享转赠送。</p>
            </div>
        </div>
        <?php
    }
    ?>
    <div class="history-list">
        <div class="history-item">
<!--            <div class="user-head-history">-->
<!--                <img src="--><?//= $user['HEADER_URL'] ?><!--"/>-->
<!--            </div>-->
            <div class="history-info"><?= date("m-d", strtotime($good['BOCREATE_DATETIME'])) ?>
                <span><?= $good['NICK_NAME'] ?></span> 赠送
            </div>
            <div class="history-right" onclick="href_card_list()">给他/她送礼</div>
        </div>
    </div>
</div>
</body>
</html>
